feat: add Superserve sandbox backend#3502
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bc707cec64
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 75c94b909d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Summary
Adds a Superserve-backed sandbox provider under
agents.extensions.sandbox.superserve, following the existing hosted sandbox extension pattern. The provider is exposed through the optionalsuperserveextra and uses thesuperservePython SDK to create, resume, execute in, and clean up sandboxes.Superserve is a Firecracker-microVM-based sandbox platform with sub-second cold starts and native pause/resume.
Supported features
SuperserveSandboxClient/SuperserveSandboxClientOptionsfor creating sandboxes from curated templates (e.g.superserve/base,superserve/python-3.11,superserve/node-22).SuperserveSandboxSession/SuperserveSandboxSessionStatefor serialized run-state resume.Commands.run, including streaming output via the SDK's SSE callbacks; timeout and transport errors map toExecTimeoutError/ExecTransportError.Files.read/Files.write, withWorkspaceReadNotFoundErroron missing files and transient-error retries on writes.persist_workspace/hydrate_workspacevia shelltarover exec.pause_on_exit=True, andclient.resume(state)that reattaches viaAsyncSandbox.connect(sandbox_id), callssandbox.resume()when the sandbox is paused, pollsget_info()untilstatus == active, and falls back to recreating onnot_found/failed/ unknown statuses.agents.extensions.sandboxso users without the extra can still import the package.Testing
tests/extensions/sandbox/test_superserve.pymirroring the coverage shape of other sandbox providers: lifecycle, exec error translation (timeout / transport / conflict), path-escape rejection, workspace tar round-trip, all four resume status branches (active,paused,resuming,failed, unknown → recreate), sandbox-local user rejection, runtime-helper cache key.tests/sandbox/test_compatibility_guards.pywith surface, option/state field-order, and round-trip parametrize entries for the new types.tests/sandbox/test_client_options.pyround-trip parametrize with aSuperserveSandboxClientOptions(template=\"superserve/base\")instance.examples/sandbox/extensions/superserve_runner.py, in both default (kill-on-exit → recreate → hydrate from local tar) and--pause-on-exit(reattach →sandbox.resume()→ poll until active) flows.Checks